<?php
// .-----------------------------------------------------------------------------------
// |  Software: [HDPHP framework]
// |   Version: 2013.01
// |      Site: http://www.hdphp.com
// |-----------------------------------------------------------------------------------
// |    Author: 向军 <houdunwangxj@gmail.com>
// | Copyright (c) 2012-2013, http://houdunwang.com. All Rights Reserved.
// |-----------------------------------------------------------------------------------
// |   License: http://www.apache.org/licenses/LICENSE-2.0
// '-----------------------------------------------------------------------------------
class CommonControl extends Control{
	public $db_infolist;
    function __auto(){
    	// 获得后台设置全局参数
    	$config = PATH_ROOT.'/admin/config/setup.php';
    	C(include $config);


    	$db = K('infoList');
    	$this->db_infolist= $db;
    	// 获得菜单数组,如果没有下级栏目，则下级显示栏目文章
    	$level = abs(C('nav_show_level'))>3?3:abs(C('nav_show_level'));
    	$result = $db->navList(0,$level);
        p($result);
    	// 获得当前位置
    	$position = $db->getPosition($this->_get('lid'),$this->_get('id'));

    	$this->assign('position',$position);//当前位置
    	$this->assign('nav',$result);//导航菜单数据分配
    	
    }
}
?>